from Daywu.yuekao.Po.Base.Base import Base
from selenium.webdriver.common.by import By
from time import sleep
class Page(Base):
    # 定位
    # 点击登录
    login_loc=(By.XPATH,'//*[@id="body"]/div[1]/div[2]/div/div[2]/div[1]/div[1]')
    # 账号登录
    zhanghao_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[1]/div/div/div/div[2]/a')
    # 手机号
    phone_loc=(By.NAME,'userName')
    # 密码
    pwd_loc=(By.CSS_SELECTOR,'#body > div.quc-panel.quc-wrapper.quc-panel-small.quc-panel-dialog.quc-panel-popup > div.quc-panel-bd > div > div > div > div.quc-login-content > form > div:nth-child(2) > div > div > input[type=password]')
    # 协议
    xieyi_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[2]/div/div/div/div[2]/form/div[4]/div/label/input')
    # 登录
    l_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[2]/div/div/div/div[2]/form/div[5]/input')
    # 输入
    shuru_loc = (By.CLASS_NAME, 'search-ipt')
    # 点击搜索
    search_loc=(By.XPATH,'//*[@id="body"]/div[3]/div/div[1]/div[1]/div[2]/div[1]/i')
    # 封装
    def login(self):
        self.click(self.login_loc)
    def zhanghao(self):
        self.click(self.zhanghao_loc)
    def phone(self):
        self.send_keys(self.phone_loc,'15614099768')
    def pwd(self):
        self.send_keys(self.pwd_loc, 'hhy041021')
    def xieyi(self):
        self.click(self.xieyi_loc)
    def l(self):
        self.click(self.l_loc)
    def shuru(self):
        self.send_keys(self.shuru_loc,'扫地')
    # 回车搜索
    def shuru1(self):
        self.enter(self.shuru_loc)
    # 业务

